import groovy.xml.MarkupBuilder

//bldr = new MarkupBuilder()
//println bldr.languages{
//    language(name: 'C++'){
//        author('Stroustrup')
//    }
//    language(name:'Java'){
//        author('Gosling')
//    }
//    language(name:'Lisp'){
//        author('McCarthy')
//    }
//}

langs = ['C++':'Stroustrup', "Java": 'Gosling', 'Lisp':'McCarthy']

writer = new StringWriter()
bldr = new MarkupBuilder(writer)
bldr.languages{
    langs.each{
        key, value ->
            language(name:key){
                author(value)
            }
    }
}


println writer

